package com.controller;

import com.service.ManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("rbacManager")
public class Mycontroller {
    //自动注入
    @Autowired(required = false)
    ManagerService managerService;

    @RequestMapping("findOne")
    public Map<Object,Object> findOne(int id){
      return managerService.findOne(id);
    }
    @RequestMapping("findAll")
    public List<Map<Object,Object>> findAll(){
        return managerService.findAll();
    }
    @RequestMapping("addOne")
    public Integer addOne(Map<Object,Object> map){
        return managerService.addOne(map);
    }
    @RequestMapping("deleteOne")
    public Integer deleteOne(int id){
        return managerService.deleteOne(id);
    }
    @RequestMapping("update")
    public Integer update(Map<Object,Object> map){
        return managerService.update(map);
    }
}
